package org.ywf.common.entity;


import org.ywf.common.enums.ResponseStatus;
import org.ywf.common.enums.ResultEnumCode;

/**
 * 返回结果包装
 * @param <T>
 */
public class ResponseData<T> {

    private ResHeader header;

    private ResponseStatus status;

    private T body;

    public ResponseData() {
    }

    public ResponseData(T body) {
        ResHeader header = new ResHeader();
        header.setReturnCode(ResultEnumCode.SUCCESS.getCode());
        header.setReturnMsg(ResultEnumCode.SUCCESS.getMsg());
        this.body = body;
        this.header = header;
        this.status = ResponseStatus.SUCCESS;
    }

    public ResHeader getHeader() {
        return header;
    }

    public void setHeader(ResHeader header) {
        this.header = header;
    }

    public T getBody() {
        return body;
    }

    public void setBody(T body) {
        this.body = body;
    }

    public ResponseStatus getStatus() {
        return status;
    }

    public void setStatus(ResponseStatus status) {
        this.status = status;
    }
}
